import java.util.Arrays;
import java.util.Scanner;

public class AG7 {
	public static void main(String[] args) {
		 Scanner scan = new Scanner(System.in);
		 int n = scan.nextInt();
		 int k = scan.nextInt();
		 int[] a = new int[n + 1];
		 int[] dp = new int[n + 1];
		 Arrays.fill(a, 1);
		 Arrays.fill(dp, 1);
		 for (int i = 0; i < k; i++) {
			 int t = scan.nextInt();
			 a[t] = 0;
			 dp[t] = 0;
		 }
		 if (n >= 2 && a[2] == 1) dp[2] = dp[1] + dp[0];
		 for (int i = 3; i < dp.length; i++) {
			 for (int j = i; j < i + 3 && j < dp.length; j++) {
				 if (a[j] == 0) continue;
				 dp[j] = dp[j - 3] + dp[j - 2] + dp[j - 1];
			 }
		 }
		 System.out.println(dp[dp.length - 1]);
		 scan.close();
	}
}
